
import java.sql.*;

public class TestJDBC {
	
	Connection conn;
	
	public TestJDBC(){
		try{
			Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
			String url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=JingYang";
			String user = "sa";
			String pass = "";
			conn = DriverManager.getConnection(url, user, pass);
			
			System.out.println("Connect Success");
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			try{
				conn.close();
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}
	
	public static void main(String []args){
		TestJDBC jdbc = new TestJDBC();
		
	}
}
